package com.example.financeapi.service.impl;

import com.example.financeapi.entity.CompanyList;
import com.example.financeapi.entity.FSecuritiesCompany;
import com.example.financeapi.mapper.FSecuritiesCompanyDao;
import com.example.financeapi.service.FSecuritiesCompanyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.stream.Collectors;

/**
 * 券商表(FSecuritiesCompany)表服务实现类
 *
 * @author makejava
 * @since 2020-12-17 22:04:28
 */
@Slf4j
@Service("fSecuritiesCompanyService")
public class FSecuritiesCompanyServiceImpl implements FSecuritiesCompanyService {
    @Resource
    private FSecuritiesCompanyDao fSecuritiesCompanyDao;

    @Override
    public FSecuritiesCompany queryAll(Integer id) {
        //List<CompanyList> resultList =new ArrayList<CompanyList>();
        List<FSecuritiesCompany> list = fSecuritiesCompanyDao.queryAll();

        List<CompanyList> list1 = (List<CompanyList>) list.stream().collect(Collectors.groupingBy(FSecuritiesCompany::getCategory));
        log.info(list1.toString());

        return null;
    }
}